home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 350 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: bubba.NMSU.Edu!usenet
  2. From: ghenniga@ampere.NMSU.Edu (Gary Hennigan)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Cross Compilation !!!
  5. Date: 04 Jan 1996 10:28:37 -0700
  6. Organization: New Mexico State University - Electromagnetics Group
  7. Sender: ghenniga@ampere.NMSU.Edu
  8. Message-ID: <rhtu42bvph6.fsf@ampere.NMSU.Edu>
  9. References: <4cdhs1$b2d@news.cic.net>
  10. Reply-To: ghenniga@NMSU.Edu
  11. NNTP-Posting-Host: ampere.nmsu.edu
  12. In-reply-to: akmp@phish.nether.net's message of 3 Jan 1996 09:22:09 GMT
  13. Cc: akmp@phish.nether.net
  14. X-Newsreader: Gnus v5.1
  15.  
  16. In an article akmp@phish.nether.net (anil kumar m p) wrote:
  17. >i am working on two languages,
  18. >C and Fortran on SGI.
  19. >i am having problems (bus error -core dumped) when i 
  20. >call Fortran functions from C.
  21. >can anyone help me out.
  22.  
  23. Perhaps.
  24.  
  25. >what about prototypes for those functions ?
  26.  
  27. You'll want to prototype all the Fortran functions you're calling from
  28. C. Otherwise it'll get confusing, FAST!
  29.  
  30. The problem is that it's often machine dependent. On the SGI (at least
  31. under IRIX 5.x and it's associated compilers) Fortran subroutines can
  32. be declared as returning "int" (see example).
  33.  
  34. >also what happens to variables that i want to pass by reference 
  35. >to fortran functions ?
  36.  
  37. Umm, I believe EVERYTHING in Fortran is passed by reference, as
  38. opposed to C where things are passed by value! If you're not adhering
  39. to that you will definately get core dumps.
  40.  
  41. >any help would be gladly appreciated
  42.  
  43. An example would allow others to help you out more efficiently.
  44.  
  45. Gary
  46. (ghenniga@NMSU.Edu)
  47.